<%@ page import="java.util.Hashtable"%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<%@ page import="userInteraction.*" %>
<%@ page import="projects.project" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<jsp:useBean id="checkAdmin" class="userInteraction.updateUserInformation"></jsp:useBean>
<jsp:setProperty property="*" name="checkAdmin"/>
<jsp:useBean id="employeeId" class="projects.project"></jsp:useBean>
<jsp:setProperty property="*" name="employeeId"/>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<script language="JavaScript" type="text/javascript" src="ajax_search.js"></script>
<script language="JavaScript" type="text/javascript" src="populateClients.js"></script>
<link rel="stylesheet" type="text/css" href="../General Info/css.css" />
<style type="text/css" media="screen">
	.suggest_link {
		background-color: #FFFFFF;
		padding: 2px 6px 2px 6px;
	}
	.suggest_link_over {
		background-color: #3366CC;
		padding: 2px 6px 2px 6px;
	}
	#search_suggest {
		position: absolute; 
		background-color: #FFFFFF; 
		text-align: left; 
		border: 1px solid #000000;			
	}		
</style>
<title>Create new project</title>
</head>

<%
	if (session.getAttribute("loggedIn") == null) {
		response.sendRedirect("../User/index.jsp");
		}
	else{
		updateUserInformation userInfo = new updateUserInformation();           //
		if(!userInfo.checkAdmin(session.getAttribute("loggedIn").toString())){  // only for admin users
			response.sendRedirect("../User/index.jsp");									//
		}
	}
%>

<body>
	 
	<jsp:include page="../General Info/header.jsp"/>
	<div class="body">
	<div class="upb">
			<div class="projects">
			<div class="projectsHeader">Create a New Project</div>
			</br>
			<form name="addNewProjectForm" onsubmit="" method="GET" action="../Projects/addProject.jsp">
				<table>
					<tr>
						<td>Client Type:</td>
						<td><select name="clientType" id="clientType" onchange="searchClients();">
							<option value="0">--Select Client Type--</option>
							<option value="1">Internal Client</option>
							<option value="2">External Client</option>
							</select></td>
					</tr>
					<tr>
						<td>Clients:</td>
						<td><select name="client" id="client" disabled="disabled">	
						</select></td>
					</tr>
					<tr>
						<td>Project Name:</td>
						<td><input id="prjName" class="" type="text" onblur="" name="prjName" /></td>
					</tr>
					<tr>
						<td>project Description:</td>
						<td><input id="prjDesc" class="" type="text" onblur="" name="prjDesc" /></td>
					</tr>
					<tr>
						<td>Start date:</td>
						<td><input id="startDate" class="" type="text" onblur="" name="startDate" /></td>
					</tr>
					<tr>
						<td>End date:</td>
						<td><input id="endDate" class="" type="text" onblur="" name="endDate" /></td>
					</tr>
					<tr>
						<td>Project Effort:</td>
						<td><input id="prjEffort" class="" type="text" onblur="" name="prjEffort" /></td>
					</tr>
					<tr>
						<td>Project state:</td>
						<td><select name="projectState">
							<option value="1">NEW</option>
							<option value="2">ACTIVE</option>
							<option value="3">COMPLETED</option>
							<option value="4">CLOSED</option>
							</select></td>
					</tr>
					<tr>
						<td>Project State Reason:</td>
						<td><input id="stateReason" class="" type="text" name="stateReason"></td>
					</tr>
					<tr>
						<td>Project Estimated Cost:</td>
						<td><input id="estimatedCost" class="" type="text" name="estimatedCost"></td>
					</tr>
					<tr>
						<td>Project Manager:</td>
						<td><input id="projectManager" onkeyup="searchEmployees();" autocomplete="off"/>
						<div id="search_suggest">
						</div><input type="hidden" name="hEmployeeId" id="hEmployeeId" value="" />          <!-- id'ul Project Managerului -->
	</td>
					</tr>
					<tr>
							<td></td>
							<td><input type="submit" class="inputButton" value="Create Project" /></td>
						</tr>
				</table>
				<% if (session.getAttribute("createProject")=="true") { %>
					<div class="successfulProjectCreation" id="successfulProjectCreation">New project added sucesfuly!!</div>
					<%session.setAttribute("createProject", null);
					}
					else{
					%><div class="notsuccessfulProjectCreation" id="notsuccessfulProjectCreation"></div>
					<%} %>
			</form>
</div>
</div>
<div class="push"></div>
</div>
<jsp:include page="../General Info/footer.jsp"/>
</body>

</html>